#include<iostream>
#include<map>
#include<string>
using namespace std;
string s1, s2;
map<char, int>mp;
int main()
{
	getline(cin, s1);
	getline(cin, s2);
	bool flag = 0;
	for (int i = 0; i < s2.size(); i++) {
		mp[s2[i]] = 1;
	}
	string ans = "";
	for (int i = 0; i < s1.size(); i++) {
		if (!mp[s1[i]]) {
			ans += s1[i];
		}
	}
	cout << ans << endl;
	return 0;
}